|
|
|
| 8. Once youre done, click the close button in the upper-right corner of the window. 9. After closing the window, youll be returned to the Visual Basic design environment. |  | Although this exercise is not very exciting, it does illustrate the point that Visual Basic is very quick at getting a Windows application up and running. To get this simple window in the C language would require over 100 lines of code. |
|
|
|
|
|
|
When a form is displayed by Visual Basic, it goes through a lifecycle. First, the form is initialized, which means any custom properties you may have created or variables in the form are created. Next, the form is loaded, which means that all the controls and any other graphical elements on the form are brought into memory. Next the form is displayed on the screen. |
|
|
|
|
|
|
|
|
After all this has happened, the user may now interact with the form. If the user closes the form, theres a series of steps it goes through to unload itself. First, an event is fired that gives you (the developer) a chance to stop the unloading from happening. Next, an event fires that unloads the graphical part of the form and all the controls on the form. Finally, if the form is released from memory, a termination event fires that releases any custom properties or variables in the form. Youll learn about each of these events in the next couple of chapters. |
|
|
|
|
|
|
|
|
Each form is made up of certain characteristics, such as its size, position, name, caption, and color. These characteristics are called properties. Properties may be changed either at runtime or design time. Some properties can only be changed at design time, and some only at runtime. It depends on the individual property. Properties are used to give forms a desired look and feel. |
|
|
|
|
|
|
|
|
Lets change a couple of properties on the form currently displayed in the design environment. |
|
|
|
|
|